Exploratory Analysis 1 - Top Crimes and Associated Demographics by Borough

Include Yaa’s



Exploratory Analysis 2 - Length of Reported Event/Crime by Borough


As another one of our exploratory analyses, we thought it would be interesting to examine whether the length of time of the reported event or crime differs by borough. Examining the length of the reported event or crime can serve as a proxy indicator of the severity of the crime by each borough, assuming that longer crimes tend to be more severe, harder to resolve, and requiring more resources to deal with.


First, we loaded the required R packages. Next, we read in the CSV file and tidied it up. For this exploratory analysis, we chose to limit the data by randomly sampling 1,000 observations from the data frame to simply the analysis a bit. We also chose to include only observations with non-missing values to the following studied variables: cmplnt_to_dt (start date of reported crime/event), cmplnt_fr_dt (end date of reported crime/event), and boro_nm (borough). The number of observations was large and sufficient enough to observe any patterns - our final analytic sample included 861 observations.


We looked at the data in a data table to examine general trends and get a feel of the data. Our data cleaning seemed to work.

## [1] "       cmplnt_fr_dt   cmplnt_to_dt   law_cat_cd   time_diff        time_diff2  boro_nm       "
## [2] "-----  -------------  -------------  -----------  --------------  -----------  --------------"
## [3] "1      2014-02-23     2014-02-26     felony       259200 secs            3.00  brooklyn      "
## [4] "2      2015-03-15     2015-03-15     felony       0 secs                 0.00  manhattan     "
## [5] "3      2017-11-07     2017-11-07     felony       0 secs                 0.00  manhattan     "
## [6] "4      2014-12-01     2014-12-02     felony       86400 secs             1.00  bronx         "


Next, we looked at whether the length of time for the reported event/crime differed by borough visually.


From the graph above, we can see a couple of things. First, there are, numerically speaking, fewer reported events in Staten Island. Secondly, the spread of the reported events seems to be slightly larger in Queens than in other boroughs. Lastly, although the spread among Brooklyn and Manhattan is approximately the same, Queens has more outliers.


You can find the code for this exploratory analysis here.



Exploratory Analysis 3 - Overall Felony Rates by Borough

For our third exploratory analysis, we chose to examine crime (i.e., felony) rates by borough. Doing so gives us an understanding as to how NYPD can prioritize their efforts when stemming crime.

First, we loaded information from the U.S. Census on total population in the individual NYC boroughs to calculate felony rates in each borough.

Next, we plotted the overall felony rates over 2014-2017 for each borough.

From the graph above, we notice some interesting findings. First, Bronx, by far, has had the highest overall felony rate from 2014-2017. Secondly, the felony rates for Brooklyn and Manhattan are very similar; this applies to Queens and Staten Island as well, which comprise the two boroughs with the lowest overall crime rates from 2014-2017. Third, we can see that felony rates decreased from 2016-2017 for all boroughs except for Brooklyn. Lastly, overall felony rates across the years for all boroughs have tended to be stable, generally speaking. Note that these are strictly sex-related, weapons-related, and drug-related felonies.



<<<<<<< HEAD

Exploratory Analysis 4 - Geographical Distribution of Crimes

Reading in the datasets

Crime distribution by zipcode for 2017

=======

Exploratory Analysis 4 - Geographical Distribution of Felonies

Our final exploratory analysis examined the geographical distribution of felonies. Examining this gives us information regarding the absolute numbers of felonies in each borough, and again, helps law enforcement officials determine where to prioritize efforts.

2017 Crime Distribution by Zip Code

>>>>>>> 6a07fb034bb4b7241ac122cb22f35f9715b254a2

Trend

Bronx has consistently had the highest crime rate over the last 4 years for all 3 types of crimes. We see a steep reduction, however, in the crime rate for the Bronx between the years of 2016 and 2017. Crime rates for all crimes in all boroughs decreased from 2016 to 2016. Surprisingly, Brooklyn has seen a consistent rise in the crime rate of drug related felonies from 2015 to 2017.